package com.example.demo.pattern.factorypattern;

import com.example.demo.pattern.factorypattern.ingredient.NYIngredientFactory;
import com.example.demo.pattern.factorypattern.pizza.NYPizzaStore;
import com.example.demo.pattern.factorypattern.pizza.Pizza;
import com.example.demo.pattern.factorypattern.pizza.PizzaStore;

public class Start {
    public static void main(String[] args) {

        // 实际使用中NYIngredientFactory和NYPizzaStore都根据情况动态new
        // 新增他们俩时，这段创建披萨的代码无需修改
        PizzaStore store = new NYPizzaStore(new NYIngredientFactory());
        Pizza result = store.createPizza("NY");
        System.out.println(result);

    }
}
